{% macro autocomplete(opts) %}
	<div class="autocomplete {{ opts.class }}" url="{{ opts.url }}" id="{{ opts.id }}">
		<input type="text" name="{{ opts.name }}" value="{{ opts.value }}"/>
		<input type="button" class="reset" />
		{% if opts.hidden %}
		<input type="hidden" name="{{ opts.hidden }}" value="{{ opts.hidden_value }}"/>
		{% endif %}
	</div>
{% endmacro %}
{% macro message(type, message) %}
	<div class="message {{ type }}">
		<div style="float: left; height: 100%">
		{% if type == "success" %}
			<img src="images/icons/Valid.png" width="20" height="20"/>
		{% elseif type == "error" %}
			<img src="images/icons/Error.png" width="20" height="20"/>
		{% endif %}
		</div>
		<div style="float: left">
		{% if message[0] is not defined %}
			{{ message }}
		{% else %}
			{% for m in message %}
				{% if not loop.first %}
					<br />
				{% endif %}
				{{ m }}
			{% endfor %}
		{% endif %}
		</div>
		<div style="clear: both"></div>
	</div>
{% endmacro %}
{% macro optionval(value, varselected) %}
value="{{ value }}" {% if value == varselected %}selected="selected"{% endif %}
{% endmacro %}
{% macro checkboxval(value, checked) %}
value="{{ value }}" {% if checked %}checked="checked"{% endif %}
{% endmacro %}
{% macro radioval(value, checked) %}
value="{{ value }}" {% if checked %}checked="checked"{% endif %}
{% endmacro %}